<?php


$clientip = getIp();

if (isset($_COOKIE["admin_token"])) {
    $token = authcode(daddslashes($_COOKIE['admin_token']), 'DECODE', SYS_KEY);
    list($username, $sid, $expiretime) = explode("\t", $token);
    $userrow = $ADDB->query("SELECT * FROM ad_user WHERE `username`='{$username}'  limit 1")->fetch();
    $session = md5($userrow['username'] . $userrow['password'] . $password_hash);
    //var_dump($sid);exit;
    if ($session == $sid && $expiretime > time()) {
        $islogin = 1;
    }
}
/*if (isset($_COOKIE["user_token"])) {
    $token = authcode(daddslashes($_COOKIE['user_token']), 'DECODE', SYS_KEY);
    list($username, $sid, $expiretime) = explode("\t", $token);
    $userrow = $ADDB->query("SELECT * FROM ad_user WHERE `username`='{$username}' limit 1")->fetch();
    $session = md5($userrow['username'] . $userrow['password'] . $password_hash);
    if ($session == $sid && $expiretime > time()) {
        $islogin2 = 1;
    }

}*/


?>